﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity.ModelConfiguration;

namespace OBUCare.Core.Models.Mapping
{
    public class SPECSMap : EntityTypeConfiguration<SPECS>
    {
        public SPECSMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.DEVICE_NAME)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.SUPPLIER_ID)
                .IsRequired();

            this.Property(t => t.SPEC_NAME)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.SPECS_IDENT)
                .IsRequired()
                .HasMaxLength(8);

            this.Property(t => t.REMARK)
                .HasMaxLength(200);

            // Table & Column Mappings
            this.ToTable("SPECS");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.SPECS_IDENT).HasColumnName("SPECS_IDENT");
            this.Property(t => t.SPEC_NAME).HasColumnName("SPEC_NAME");
            this.Property(t => t.SUPPLIER_ID).HasColumnName("SUPPLIER_ID");
            this.Property(t => t.VERSION_ID).HasColumnName("VERSION_ID");
            this.Property(t => t.REMARK).HasColumnName("REMARK");
            this.Property(t => t.DEVICE_NAME).HasColumnName("DEVICE_NAME");
         }
    }
}
